{% load static %}
{% load thumbnail %}

{% comment %} {% for post in last_5_posts %}
<article class="mini-post">
    <header>
        <h3><a href="{% url 'logs:log' post.id %}">{{ post.description }}</a></h3>
        <time class="published" datetime="#">{{ post.date_added|date:"d E Y" }}</time>
        {% thumbnail post.owner.avatar "100x100" crop="center" upscale=True as im %}
            <a href="#" class="author">{{ post.owner.get_username }}<img src="{{ im.url }}" alt="" /></a>
		{% endthumbnail %}
    </header>
    <a href="single.html" class="image"><img src="{% static 'images/pic07.jpg' %}" alt="" /></a>
</article>
{% endfor %} {% endcomment %}

{% for post in last_5_posts %}
<section>
    <ul class="posts">
        <li>
            {% comment %} <div class="title">
                <h2><a href="{% url 'logs:log' post.id %}">{{ post.description }}</a></h2>
                {% comment %} <p>{% url 'logs:log' log.id %}</p> {% endcomment %}
            {% comment %} </div> {% endcomment %} 
            <article>
                <header>
                <h3><a href="{% url 'logs:log' post.id %}">{{ post.description }}</a></h3>
                <time class="published" datetime="#">{{ post.date_added|date:"d E Y" }}</time>
                {% comment %} <a href="{% url 'logs:user_logs' post.owner.get_username %}" class="author"><span class="name">Добавил: {{ post.owner.get_username }}</span></a> {% endcomment %}
                {% thumbnail post.owner.avatar "50x50" crop="center" upscale=True as im %}
                <a href="{% url 'logs:user_logs' post.owner.get_username %}" class="author"><span class="name">Добавил: {{ post.owner.get_username }}</span><img src="{{ im.url }}" alt="" /></a>
                {% endthumbnail %}
                </header>
                {% comment %} <header>
                    <h3><a href="{% url 'logs:log' post.id %}">{{ post.description }}</a></h3>
                    {% with text=post.text|truncatewords:15 %}
			            {{ text }}
		            {% endwith %}
                    <time class="published" datetime="#">{{ post.date_added|date:"d E Y" }}</time>
                    {% thumbnail post.owner.avatar "50x50" crop="center" upscale=True as im %}
                        <a href="#" class="author"><img src="{{ im.url }}" alt="" /></a>
                    {% endthumbnail %}
            </header> {% endcomment %}
        
            </article>
            {% if not forloop.last %}<hr>{% endif %}
        </li>
    </ul>
</section>
{% endfor %}
